<template>
  <div style="display: flex;">
    <div class="label">{{ label }}</div>
    <div class="image-list">
      <div v-for="(item, index) in data" :key="index">
        <el-image
          style="width: 80px; height: 80px"
          :src="item"
          :preview-src-list="data"
        >
          <div slot="placeholder" class="image-slot">
            加载中<span class="dot">...</span>
          </div>
        </el-image>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    data: {
      type: Array,
      default: () => ([])
    },
    label: {
      type: String,
      default: () => ''
    }
  }
}

</script>

<style scoped>
.label {
  width: 100px;

}
.image-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background-color: rgb(246, 247, 250);
}

.image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
</style>
